home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Apple II Magazines (PO)
/
Nibble Volume 12, No. 12 (1991-12)(MindCraft Publishing)(Side A)[a].zip
/
Nibble Volume 12, No. 12 (1991-12)(MindCraft Publishing)(Side A)[a].po
/
SMALLEST.FIND.bas
< prev
next >
Wrap
BASIC Source File
|
1996-12-24
|
528b
|
13 lines
10 REM PROGRAM SMALLEST.FIND
20 REM FIND THE SMALLEST NUMBER IN AN ARRAY
30 DIM A(10): REM ARRAY CAN BE ANY SIZE
40 HOME : PRINT "ENTER 10 NUMBERS THAT WILL BE CHECKED": PRINT
50 FOR X = 1 TO 10: PRINT "INPUT ";X;" =>";: INPUT A
60 A(X) = A: NEXT : REM GET 10 NUMBERS
70 V1 = A(1): REM START WITH THE FIRST NUMBER
80 FOR X = 2 TO 10: REM CHECK THE REST OF THE ARRAY
90 V2 = A(X): IF V2 <V1 THEN V1 = V2
100 NEXT : REM CHECK ALL 10 NUMBERS
110 VMIN = V1
120 PRINT : PRINT "THE SMALLEST NUMBER IS ";VMIN
130 END